package org.jpro.exception;

import lombok.Getter;

/**
 * <P>功能描述 : 系统基本异常</P>
 * <P>File name : BaseException </P>
 * <P>Author : 王泽浩 </P>
 * <P>E-Mail : 1028625100@qq.com </P>
 * <P>Date : 2017/1/1 上午12:23</P>
 */
@Getter
public class BaseException extends Exception {
    private static final long serialVersionUID = 7820777420560963442L;

    /**
     * 异常
     */
    private ExceptionCode code;

    /**
     * 构造函数
     * @param msg
     */
    public BaseException(String msg) {
        super(msg);
    }

    /**
     * 构造函数
     * @param code
     */
    public BaseException(ExceptionCode code) {
        this(code.getMsg());
        this.code = code;
    }

    /**
     * 自定义异常信息构造
     * @param code
     * @param msg
     */
    public BaseException(ExceptionCode code, String msg) {
        this(msg);
        this.code = code;
    }

}
